home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
program
/
palis.lha
/
Palis
/
src
/
pl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-02
|
2KB
|
125 lines
/*
·C·O·D·E·X· ·D·E·S·I·G·N· ·S·O·F·T·W·A·R·E·
presents
PatchLibraries Utility
FILE: pl.c
TASK: control stuff
(c)1995 by Hans Bühler
*/
#include "pl.h"
// ---------------------------
// defines
// ---------------------------
// ---------------------------
// datatypes
// ---------------------------
// ---------------------------
// proto
// ---------------------------
static BOOL InitSys(void);
static void RemSys(void);
// ---------------------------
// vars
// ---------------------------
#ifndef FINAL
struct Library *CxBase = 0;
struct MsgPort *CxPort = 0;
#endif
// ---------------------------
extern char *__version = PROGNAME_VER,
*__procname = PROGNAME;
// ---------------------------
// funx: init/rem system...
// ---------------------------
/***************************************************
* Alle system-libs, die benötigt werden, öffnen ! *
***************************************************/
static BOOL InitSys(void)
{
if(SysBase->LibNode.lib_Version < 37)
return ErrorReq("ERROR: AmigaOS V2.04+ required !",0,0,0,0);
#ifndef FINAL
if(!( CxBase = OpenLibrary("commodities.library",37) ))
{
return ErrorReq( "ERROR: Cannot open commodities.library V37+.",0,0,0,0);
}
if(!( CxPort = CreateMsgPort() ))
{
return ErrorReq( " ERROR: Cannot create msgports !",0,0,0,0);
}
#endif
return TRUE;
}
/*********************
* weg mit den allox *
*********************/
static void RemSys(void)
{
#ifndef FINAL
if(CxPort)
{
struct Message *msg;
while(msg = GetMsg(CxPort))
ReplyMsg(msg);
DeleteMsgPort(CxPort);
}
if(CxBase)
CloseLibrary(CxBase);
#endif
}
// ---------------------------
// funx: main()
// ---------------------------
void main(int argc, char *argv[])
{
if(InitSys())
{
#ifndef FINAL
if(InitCom())
{
#endif
if(InitMyFunc())
{
MainLoop();
}
RemMyFunc();
#ifndef FINAL
}
RemCom();
#endif
}
RemSys();
}